]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
cleanup: Use rest parameters instead of arguments
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 12 Feb 2019 11:24:30 +0000 (12:24 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 1 Jul 2019 21:44:10 +0000 (23:44 +0200)
Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607

js/extensionPrefs/main.js
js/ui/environment.js
js/ui/tweener.js

index 24ecdc165db0a723fe3515bdcfcfd78f5111b95c..b0be67f4913832b267e0a46028d010a405445431 100644 (file)
@@ -611,8 +611,8 @@ function initEnvironment() {
     // Monkey-patch in a "global" object that fakes some Shell utilities
     // that ExtensionUtils depends on.
     window.global = {
-        log() {
-            print([].join.call(arguments, ', '));
+        log(...args) {
+            print(args.join(', '));
         },
 
         logError(s) {
index f7039471084ab557af317b94ac23096dc4221242..573857126fb70197c4f6b0ba1702cb686af67657 100644 (file)
@@ -57,8 +57,8 @@ function _patchLayoutClass(layoutClass, styleProps) {
     };
 }
 
-function _loggingFunc() {
-    let fields = {'MESSAGE': [].join.call(arguments, ', ')};
+function _loggingFunc(...args) {
+    let fields = {'MESSAGE': args.join(', ')};
     let domain = "GNOME Shell";
 
     // If the caller is an extension, add it as metadata
index 946506a3a909b7dd53afa5f3e50965144a31c02a..26f3aeb0e92e91dd43aeaedcfddb8ea54d7a7666 100644 (file)
@@ -109,8 +109,9 @@ function isTweening(scope) {
     return Tweener.getTweenCount(scope) != 0;
 }
 
-function removeTweens(scope) {
-    if (Tweener.removeTweens.apply(null, arguments)) {
+function removeTweens(...args) {
+    if (Tweener.removeTweens(args)) {
+        let [scope] = args;
         // If we just removed the last active tween, clean up
         if (Tweener.getTweenCount(scope) == 0)
             _tweenCompleted(scope);
@@ -119,12 +120,12 @@ function removeTweens(scope) {
         return false;
 }
 
-function pauseTweens() {
-    return Tweener.pauseTweens.apply(null, arguments);
+function pauseTweens(...args) {
+    return Tweener.pauseTweens(...args);
 }
 
-function resumeTweens() {
-    return Tweener.resumeTweens.apply(null, arguments);
+function resumeTweens(...args) {
+    return Tweener.resumeTweens(...args);
 }